// components/item-components/check-component.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    checked: {
      type: Boolean,
      value: false
    },
    key:{
      type:String,
      value:null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    icon_normal: '/images/icon_check_normal.png',
    icon_selected: '/images/icon_check_selected.png',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    _action_check:function(e){
      let checked = this.data.checked;
      this.setData({
        checked: !checked
      })
      var dataInfo = e.currentTarget.dataset;
      if(this.data.key){
        dataInfo["key"] = this.data.key;
      }

      this.triggerEvent('checked', dataInfo, "myEventOption")
    }
  }
})
